#ifndef RBinaryReader_h
#define RBinaryReader_h

// Riccsson includes.
#include <System/RCore.h>
#include <System/String.h>
#include <System/Array.h>
#include <System/Object.h>
#include <System/IO/Stream.h>
#include <System/IO/FileMode.h>

// CSharp includes.
#include <Defines.h>

namespace Riccsson
{
	namespace System
	{
		namespace Collections
		{
			namespace Generic
			{
				template<typename T> class Task
				{

				};
			}
		}
		namespace IO
		{
			class IAsyncResult;
			class SafeFileHandle;
			class AsyncCallback;
			class CancellationToken;
			class Task;
			class FileSecurity;
			class Encoding;

			// Summary:
			//     Reads primitive data types as binary values in a specific encoding.
			//[ComVisible(true)]
			class BinaryReader
				: Riccsson::System::Object
				, IDisposable
			{
				// Summary:
				//     Initializes a new instance of the System.IO.BinaryReader class based on the
				//     specified stream and using UTF-8 encoding.
				//
				// Parameters:
				//   input:
				//     The input stream.
				//
				// Exceptions:
				//   System.ArgumentException:
				//     The stream does not support reading, is null, or is already closed.
				//[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
				public: BinaryReader(Stream* input)
				{
					throw;
				}

				//
				// Summary:
				//     Initializes a new instance of the System.IO.BinaryReader class based on the
				//     specified stream and character encoding.
				//
				// Parameters:
				//   input:
				//     The input stream.
				//
				//   encoding:
				//     The character encoding to use.
				//
				// Exceptions:
				//   System.ArgumentException:
				//     The stream does not support reading, is null, or is already closed.
				//
				//   System.ArgumentNullException:
				//     encoding is null.
				public: BinaryReader(Stream* input, Encoding* encoding)
				{
					throw;
				}

				//
				// Summary:
				//     Initializes a new instance of the System.IO.BinaryReader class based on the
				//     specified stream and character encoding, and optionally leaves the stream
				//     open.
				//
				// Parameters:
				//   input:
				//     The input stream.
				//
				//   encoding:
				//     The character encoding to use.
				//
				//   leaveOpen:
				//     true to leave the stream open after the System.IO.BinaryReader object is
				//     disposed; otherwise, false.
				//
				// Exceptions:
				//   System.ArgumentException:
				//     The stream does not support reading, is null, or is already closed.
				//
				//   System.ArgumentNullException:
				//     encoding or input is null.
				public: BinaryReader(Stream* input, Encoding* encoding, bool leaveOpen)
				{
					throw;
				}


				// Summary:
				//     Exposes access to the underlying stream of the System.IO.BinaryReader.
				//
				// Returns:
				//     The underlying stream associated with the BinaryReader.
				public: virtual PROP3_GET(GC_PTR<Stream>, BaseStream)
				{
					throw;
				}
				private: virtual PROP3_SET(GC_PTR<Stream>, BaseStream){throw;}

				// Summary:
				//     Closes the current reader and the underlying stream.
				public: virtual void Close()
				{
					throw;
				}

				//
				// Summary:
				//     Releases all resources used by the current instance of the System.IO.BinaryReader
				//     class.
				public: void Dispose()
				{
					throw;
				}

				//
				// Summary:
				//     Releases the unmanaged resources used by the System.IO.BinaryReader class
				//     and optionally releases the managed resources.
				//
				// Parameters:
				//   disposing:
				//     true to release both managed and unmanaged resources; false to release only
				//     unmanaged resources.
				protected: virtual void Dispose(bool disposing)
				{
					throw;
				}

				//
				// Summary:
				//     Fills the /*internal*/ buffer with the specified number of bytes read from the
				//     stream.
				//
				// Parameters:
				//   numBytes:
				//     The number of bytes to be read.
				//
				// Exceptions:
				//   System.IO.EndOfStreamException:
				//     The end of the stream is reached before numBytes could be read.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				//
				//   System.ArgumentOutOfRangeException:
				//     Requested numBytes is larger than the /*internal*/ buffer size.
				protected: virtual void FillBuffer(int numBytes)
				{
					throw;
				}

				//
				// Summary:
				//     Returns the next available character and does not advance the byte or character
				//     position.
				//
				// Returns:
				//     The next available character, or -1 if no more characters are available or
				//     the stream does not support seeking.
				//
				// Exceptions:
				//   System.IO.IOException:
				//     An I/O error occurs.
				//
				//   System.ArgumentException:
				//     The current character cannot be decoded into the /*internal*/ character buffer
				//     by using the System.Text.Encoding selected for the stream.
				public: virtual int PeekChar()
				{
					throw;
				}

				//
				// Summary:
				//     Reads characters from the underlying stream and advances the current position
				//     of the stream in accordance with the Encoding used and the specific character
				//     being read from the stream.
				//
				// Returns:
				//     The next character from the input stream, or -1 if no characters are currently
				//     available.
				//
				// Exceptions:
				//   System.IO.IOException:
				//     An I/O error occurs.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				public: virtual int Read()
				{
					throw;
				}

				//
				// Summary:
				//     Reads the specified number of bytes from the stream, starting from a specified
				//     point in the byte array.
				//
				// Parameters:
				//   buffer:
				//     The buffer to read data into.
				//
				//   index:
				//     The starting point in the buffer at which to begin reading into the buffer.
				//
				//   count:
				//     The number of bytes to read.
				//
				// Returns:
				//     The number of bytes read into buffer. This might be less than the number
				//     of bytes requested if that many bytes are not available, or it might be zero
				//     if the end of the stream is reached.
				//
				// Exceptions:
				//   System.ArgumentException:
				//     The buffer length minus index is less than count. -or-The number of decoded
				//     characters to read is greater than count. This can happen if a Unicode decoder
				//     returns fallback characters or a surrogate pair.
				//
				//   System.ArgumentNullException:
				//     buffer is null.
				//
				//   System.ArgumentOutOfRangeException:
				//     index or count is negative.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				public: virtual int Read(Riccsson::System::Array<byte>* buffer, int index, int count)
				{
					throw;
				}

				//
				// Summary:
				//     Reads the specified number of characters from the stream, starting from a
				//     specified point in the character array.
				//
				// Parameters:
				//   buffer:
				//     The buffer to read data into.
				//
				//   index:
				//     The starting point in the buffer at which to begin reading into the buffer.
				//
				//   count:
				//     The number of characters to read.
				//
				// Returns:
				//     The total number of characters read into the buffer. This might be less than
				//     the number of characters requested if that many characters are not currently
				//     available, or it might be zero if the end of the stream is reached.
				//
				// Exceptions:
				//   System.ArgumentException:
				//     The buffer length minus index is less than count. -or-The number of decoded
				//     characters to read is greater than count. This can happen if a Unicode decoder
				//     returns fallback characters or a surrogate pair.
				//
				//   System.ArgumentNullException:
				//     buffer is null.
				//
				//   System.ArgumentOutOfRangeException:
				//     index or count is negative.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				//[SecuritySafeCritical]
				public: virtual int Read(Riccsson::System::Array<char>* buffer, int index, int count)
				{
					throw;
				}

				//
				// Summary:
				//     Reads in a 32-bit integer in compressed format.
				//
				// Returns:
				//     A 32-bit integer in compressed format.
				//
				// Exceptions:
				//   System.IO.EndOfStreamException:
				//     The end of the stream is reached.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				//
				//   System.FormatException:
				//     The stream is corrupted.
				protected: /*internal*/ int Read7BitEncodedInt()
				{
					throw;
				}

				//
				// Summary:
				//     Reads a Boolean value from the current stream and advances the current position
				//     of the stream by one byte.
				//
				// Returns:
				//     true if the byte is nonzero; otherwise, false.
				//
				// Exceptions:
				//   System.IO.EndOfStreamException:
				//     The end of the stream is reached.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				//[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
				public: virtual bool ReadBoolean()
				{
					throw;
				}

				//
				// Summary:
				//     Reads the next byte from the current stream and advances the current position
				//     of the stream by one byte.
				//
				// Returns:
				//     The next byte read from the current stream.
				//
				// Exceptions:
				//   System.IO.EndOfStreamException:
				//     The end of the stream is reached.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				public: virtual byte ReadByte()
				{
					throw;
				}

				//
				// Summary:
				//     Reads the specified number of bytes from the current stream into a byte array
				//     and advances the current position by that number of bytes.
				//
				// Parameters:
				//   count:
				//     The number of bytes to read.
				//
				// Returns:
				//     A byte array containing data read from the underlying stream. This might
				//     be less than the number of bytes requested if the end of the stream is reached.
				//
				// Exceptions:
				//   System.ArgumentException:
				//     The number of decoded characters to read is greater than count. This can
				//     happen if a Unicode decoder returns fallback characters or a surrogate pair.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.ArgumentOutOfRangeException:
				//     count is negative.
				public: virtual GC_PTR<Riccsson::System::Array<byte>> ReadBytes(int count)
				{
					throw;
				}

				//
				// Summary:
				//     Reads the next character from the current stream and advances the current
				//     position of the stream in accordance with the Encoding used and the specific
				//     character being read from the stream.
				//
				// Returns:
				//     A character read from the current stream.
				//
				// Exceptions:
				//   System.IO.EndOfStreamException:
				//     The end of the stream is reached.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				//
				//   System.ArgumentException:
				//     A surrogate character was read.
				public: virtual char ReadChar()
				{
					throw;
				}

				//
				// Summary:
				//     Reads the specified number of characters from the current stream, returns
				//     the data in a character array, and advances the current position in accordance
				//     with the Encoding used and the specific character being read from the stream.
				//
				// Parameters:
				//   count:
				//     The number of characters to read.
				//
				// Returns:
				//     A character array containing data read from the underlying stream. This might
				//     be less than the number of characters requested if the end of the stream
				//     is reached.
				//
				// Exceptions:
				//   System.ArgumentException:
				//     The number of decoded characters to read is greater than count. This can
				//     happen if a Unicode decoder returns fallback characters or a surrogate pair.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				//
				//   System.ArgumentOutOfRangeException:
				//     count is negative.
				//[SecuritySafeCritical]
				public: virtual GC_PTR<Riccsson::System::Array<char>> ReadChars(int count)
				{
					throw;
				}

				//
				// Summary:
				//     Reads a decimal value from the current stream and advances the current position
				//     of the stream by sixteen bytes.
				//
				// Returns:
				//     A decimal value read from the current stream.
				//
				// Exceptions:
				//   System.IO.EndOfStreamException:
				//     The end of the stream is reached.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				public: virtual decimal ReadDecimal()
				{
					throw;
				}

				//
				// Summary:
				//     Reads an 8-byte floating point value from the current stream and advances
				//     the current position of the stream by eight bytes.
				//
				// Returns:
				//     An 8-byte floating point value read from the current stream.
				//
				// Exceptions:
				//   System.IO.EndOfStreamException:
				//     The end of the stream is reached.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				//[SecuritySafeCritical]
				public: virtual double ReadDouble()
				{
					throw;
				}

				//
				// Summary:
				//     Reads a 2-byte signed integer from the current stream and advances the current
				//     position of the stream by two bytes.
				//
				// Returns:
				//     A 2-byte signed integer read from the current stream.
				//
				// Exceptions:
				//   System.IO.EndOfStreamException:
				//     The end of the stream is reached.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				//[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
				public: virtual short ReadInt16()
				{
					throw;
				}

				//
				// Summary:
				//     Reads a 4-byte signed integer from the current stream and advances the current
				//     position of the stream by four bytes.
				//
				// Returns:
				//     A 4-byte signed integer read from the current stream.
				//
				// Exceptions:
				//   System.IO.EndOfStreamException:
				//     The end of the stream is reached.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				public: virtual int ReadInt32()
				{
					throw;
				}

				//
				// Summary:
				//     Reads an 8-byte signed integer from the current stream and advances the current
				//     position of the stream by eight bytes.
				//
				// Returns:
				//     An 8-byte signed integer read from the current stream.
				//
				// Exceptions:
				//   System.IO.EndOfStreamException:
				//     The end of the stream is reached.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				public: virtual long ReadInt64()
				{
					throw;
				}

				//
				// Summary:
				//     Reads a signed byte from this stream and advances the current position of
				//     the stream by one byte.
				//
				// Returns:
				//     A signed byte read from the current stream.
				//
				// Exceptions:
				//   System.IO.EndOfStreamException:
				//     The end of the stream is reached.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				//[CLSCompliant(false)]
				//[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
				public: virtual sbyte ReadSByte()
				{
					throw;
				}

				//
				// Summary:
				//     Reads a 4-byte floating point value from the current stream and advances
				//     the current position of the stream by four bytes.
				//
				// Returns:
				//     A 4-byte floating point value read from the current stream.
				//
				// Exceptions:
				//   System.IO.EndOfStreamException:
				//     The end of the stream is reached.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				//[SecuritySafeCritical]
				public: virtual float ReadSingle()
				{
					throw;
				}

				//
				// Summary:
				//     Reads a string from the current stream. The string is prefixed with the length,
				//     encoded as an integer seven bits at a time.
				//
				// Returns:
				//     The string being read.
				//
				// Exceptions:
				//   System.IO.EndOfStreamException:
				//     The end of the stream is reached.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				public: virtual GC_PTR<Riccsson::System::string> ReadString()
				{
					throw;
				}

				//
				// Summary:
				//     Reads a 2-byte unsigned integer from the current stream using little-endian
				//     encoding and advances the position of the stream by two bytes.
				//
				// Returns:
				//     A 2-byte unsigned integer read from this stream.
				//
				// Exceptions:
				//   System.IO.EndOfStreamException:
				//     The end of the stream is reached.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				//[CLSCompliant(false)]
				public: virtual ushort ReadUInt16()
				{
					throw;
				}

				//
				// Summary:
				//     Reads a 4-byte unsigned integer from the current stream and advances the
				//     position of the stream by four bytes.
				//
				// Returns:
				//     A 4-byte unsigned integer read from this stream.
				//
				// Exceptions:
				//   System.IO.EndOfStreamException:
				//     The end of the stream is reached.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				//[CLSCompliant(false)]
				public: virtual uint ReadUInt32()
				{
					throw;
				}

				//
				// Summary:
				//     Reads an 8-byte unsigned integer from the current stream and advances the
				//     position of the stream by eight bytes.
				//
				// Returns:
				//     An 8-byte unsigned integer read from this stream.
				//
				// Exceptions:
				//   System.IO.EndOfStreamException:
				//     The end of the stream is reached.
				//
				//   System.IO.IOException:
				//     An I/O error occurs.
				//
				//   System.ObjectDisposedException:
				//     The stream is closed.
				//[CLSCompliant(false)]
				public: virtual ulong ReadUInt64()
				{
					throw;
				}

			};
		}
	}
}

#endif